package com.luxiu.extensionlib.base

import android.app.Application
import androidx.lifecycle.ViewModelStore
import androidx.lifecycle.ViewModelStoreOwner
import java.io.File

abstract class BaseApplication(override val viewModelStore: ViewModelStore) : Application(), ViewModelStoreOwner {


    override fun onCreate() {
        super.onCreate()
        //声明Activity管理
        externalRoot = getExternalFilesDir(null)!!
        mActivityManager = BaseActivityManager()
        mApplication = this
        initViewModel()
    }

    abstract fun initViewModel()

    companion object {
        var mActivityManager: BaseActivityManager? = null
        lateinit var mApplication: BaseApplication
        lateinit var externalRoot: File
    }
}